<template>
	<view>
		<view class="">
			<!-- 1 -->

			<!-- 2 -->
			<view class="">
				<view class="">
					<view class=""><u-search margin="22rpx 20rpx 28rpx 42rpx" placeholder="搜索" v-model="keyword" :showAction="false"></u-search></view>
				</view>
			</view>

			<!-- 3 -->
			<view class="">
				<view class="ml36 mr44">
					<view class="item" v-for="item in moreList" :key="item">
						<view class="flex-around">
							<view class="mt18 ms16 mr16"><image src="../../static/img/addCc/Container.png" mode="" style="width: 96rpx;height: 96rpx;"></image></view>
							<view class="size_30 mr40">{{ item.uname }}</view>
							<view class="color_AA size_24 mr150">{{ item.ucurrentSize }}/{{ item.ugroupSize }}</view>
							<view class="color_AA size_24">> 400m 南山</view>
						</view>
						<u-gap height="1" bgColor="#CFD4DC" customStyle="opacity: 0.24;"></u-gap>
					</view>
				</view>
			</view>
		</view>

		<view class="" style="display: none;">
			<view-navbar></view-navbar>
			<view class="">
				<view class="">
					<view class="">
						<!-- 1 -->
						<view class="margin mr54 ml54 ">
							<view class="flex-start flex-align" style="margin-top:10rpx ; margin-bottom: 16rpx;">
								<view class="mr42"><u-icon name="arrow-left" color="#000" size="25" @click="back" style=""></u-icon></view>
								<view class="size_48 fb color_1b mr300">加入圈子</view>
								<view class=""><image src="/static/img/addCc/182.png" mode="" style="width: 27rpx;height: 27rpx;"></image></view>
							</view>
						</view>
						<u-gap height="1" bgColor="#CFD4DC" customStyle="opacity: 0.24;"></u-gap>
						<!-- 2 -->
						<view class="">
							<view class="">
								<view class=""><u-search margin="22rpx 20rpx 28rpx 42rpx" placeholder="搜索" v-model="keyword" :showAction="false"></u-search></view>
							</view>
						</view>
						<!-- 3 -->
						<view class="">
							<view class="ml36 mr44">
								<view class="item" v-for="item in moreList" :key="item">
									<view class="flex-around">
										<view class="mt18 ms16 mr16"><image src="../../static/img/addCc/Container.png" mode="" style="width: 96rpx;height: 96rpx;"></image></view>
										<view class="size_30 mr40">{{ item.uname }}</view>
										<view class="color_AA size_24 mr150">{{ item.ucurrentSize }}/{{ item.ugroupSize }}</view>
										<view class="color_AA size_24">> 400m 南山</view>
									</view>
									<u-gap height="1" bgColor="#CFD4DC" customStyle="opacity: 0.24;"></u-gap>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			moreList: []
		};
	},
	onShow() {
		this.getMoreList();
	},
	methods: {
		/* 附近群聊 */
		async getMoreList() {
			let re = await this.$API.groupApi.nearbyGroup();
			console.log(re, 're');
			this.moreList = re.records;
		},
		back() {
			/*uni.navigateBack({
					delta: 1
				})*/
			//@zxyuns 处理兼容，如果没有上一级界面则返回首页
			const pages = getCurrentPages();
			if (pages.length === 2) {
				uni.navigateBack({
					delta: 1
				});
			} else if (pages.length === 1) {
				uni.switchTab({
					url: '/pages/home/home'
				});
			} else {
				uni.navigateBack({
					delta: 1
				});
			}
		}
	}
};
</script>

<style lang="scss"></style>
